import React from 'react';
import ReactDOM from 'react-dom';



function App() {
    return (<div>
        <div>A
            <div>1</div>            
        </div>
    </div>)
}
function render (element,parentDOM){
    let dom  = document.createElement(element,parentDOM)
    Object.keys(element.props)
    .filter(key=>key!=='children')
    .forEach(key=>{
        dom[key] = element.props[key]
    })
    if(Array.isArray(element.props.children)){
        element.props.children.forEach(child=>{
            render(child,dom)
        })
    }
}

render(
        <App />,
        document.getElementById('root')
 );


